import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Demo {
    public static void main(String[] args) {
        String key="name";
        String regex = "\"" + key + "\": (.*?)\"|(\\d*)";
        String res="{\"share\":{\"availability_zone\":\"cn-gzTb\",\"enterprise_project_id\":" +
                "\"0\",\"flavor_ref\":\"sfs.turbo.standard\",\"name\":\"sfs-turbo-dca2\"," +
                "\"order_id\":\"80d0f312be0b4c129f9daf5e206de269\",\"security_group_id\":" +
                "\"1b4703ea-954b-4390-b4e0-77a9c9f6fdd6\",\"share_proto\":\"NFS\",\"share_type\":\"STANDARD\"," +
                "\"size\":500,\"subnet_id\":\"fd600e60-b5e0-4b2b-a80e-e2b95d255598\",\"vpc_id\":\"3f312967-7ea2-4dd5-ba7a-64a4cb8580bd\"}}\n";

        String temp="{\"az\":\"cn-gzTb\",\"backupStrategyInfo\":{\"beginTime\":\"18:00:00\",\"endTime\":\"19:00:00\"},\"clusterMode\":\"ReplicaSet\",\"count\":1,\"dbType\":\"mongodb\",\"enableIpv6\":\"0\",\"engine\":\"wiredTiger\",\"name\":\"CESHIxx\",\"openSlowLogPlaintext\":false,\"payInfo\":{\"isAutoRenew\":0,\"orderId\":\"06deddbe41b44727b1950d74eaeae7b8\",\"payModel\":\"1\",\"period\":1,\"periodType\":2},\"region\":\"cn-gzT\",\"replicaFlavor\":{\"flavor\":\"13c5d34c-3c7e-3ba3-804f-84c578ca6894\",\"num\":1,\"parameterGroupId\":\"0764fdcd949b411ba76c2b762b80c212pr02\",\"size\":10,\"storage\":\"ULTRAHIGH\"},\"securitygroup\":\"84276e66-f3c6-423f-bd61-75c6170c2587\",\"sslOption\":\"0\",\"subnet\":\"cbbcd80a-06c6-4bf0-bf45-23deb30550a3\",\"tagsInfo\":{\"sysTags\":[{\"key\":\"_sys_enterprise_project_id\",\"value\":\"1be9a369-6543-4c36-85f7-ceb4904722d6\"}]},\"userName\":\"rwuser\",\"version\":\"4.0\",\"vpc\":\"2d7cef73-1a4f-470a-b049-6bb2f226be2e\"}\n";

        String ans="{\"payInfo\":{\"payModel\":\"1\",\"orderId\":\"2f80ae524780425e9ada4693c8149ba2\",\"period\":1,\"periodType\":2,\"isAutoRenew\":0},\"region\":\"cn-gzT\",\"name\":\"dds-8b31\",\"count\":1,\"version\":\"4.0\",\"dbType\":\"mongodb\",\"engine\":\"wiredTiger\",\"replicaFlavor\":{\"num\":1,\"flavor\":\"13c5d34c-3c7e-3ba3-804f-84c578ca6894\",\"storage\":\"ULTRAHIGH\",\"size\":100,\"parameterGroupId\":\"0764fdcd949b411ba76c2b762b80c212pr02\"},\"clusterMode\":\"ReplicaSet\",\"az\":\"cn-gzTb\",\"vpc\":\"292c91a8-b598-4845-85e7-277bb93eef17\",\"subnet\":\"23e6d18b-55bf-4926-a7b1-fc46cdec7e7d\",\"securitygroup\":\"68f78b08-7178-4437-8b5d-a3f569f148c5\",\"userName\":\"rwuser\",\"sslOption\":\"0\",\"backupStrategyInfo\":{\"beginTime\":\"17:00:00\",\"endTime\":\"18:00:00\"},\"enableIpv6\":\"0\",\"openSlowLogPlaintext\":false}";
        matchJson(ans);
        System.err.println(String.format("name---value的值为:%s", "ssssss"));

    }

    public static void matchJson(String  content) {

        String regex = "(?<=(\"" + "name" + "\":\")).*?(?=(\"))";
        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(content);
        while (m.find()) {
            String group = m.group();
            System.out.println(group);
        }
    }

}




